package com.home.free.proxy;

import org.springframework.beans.factory.annotation.Autowired;

public class Proxy implements Subject {
    @Autowired
    private RealSubject realSubject;

    @Override
    public void Request() {
        preRequest();
        realSubject.Request();
        postRequest();
    }

    private void preRequest() {
        System.out.println("访问真实主题之前的预处理。");
    }

    private void postRequest() {
        System.out.println("访问真实主题之后的后续处理。");
    }
}
